<template>
    <div>
        <div>query电影详情页{{ $route.query.id }}</div>
        <div>params电影详情页{{this.$route.params.id}} </div>
        <img src="" alt="">
        <img :src="detail.cover" alt="">
        <h4>电影名称：{{ detail.title}}</h4>
        <h4>电影主演：{{detail.star_actor}}</h4>
        <h4>电影时间：{{ detail.showingon}}</h4>
        <h4>电影时长：{{ detail.duration }}分钟</h4>

    </div>
</template>

<script>
import myaxios from '../http/MyAxios'
    export default {
        data() {
            return {
                detail:{}
            }
        },
        methods: {

        },
        beforeCreate(){     console.log('详情页 beforeCreate')},
        created(){     console.log('详情页 created')},
        beforeMount(){     console.log('详情页 beforeMount')},
        mounted(){     console.log('详情页 mounted')},
        befroUpdate(){     console.log('详情页 befroUpdate')},
        updated(){     console.log('详情页 updated')},
        beforeDestroy(){     console.log('详情页 beforeDestroy')},
        destroyed(){     console.log('详情页 destroyed')},
        mounted () { 
            let id = this.$route.query.id || this.$route.params.id
            let url = 'https://web.codeboy.com/bmdapi/movie-info/query'
            myaxios.get(url,{id}).then(res=>{
                console.log('电影详情信息：',res);
                this.detail = res.data.data
                })
        },
    }
</script>

<style lang="scss" scoped>

</style>